﻿using LeRenard.ScriptWars.Model.Entities;
using System;
using System.Collections.Generic;

namespace LeRenard.ScriptWars.Model.Scripting.Definitions
{
    /// <summary>
    /// Defines an operation.
    /// </summary>
    public interface IOperationDefinition
    {
        /// <summary>
        /// Gets the operation's name.
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Gets the operation's parameters.
        /// </summary>
        IReadOnlyDictionary<int, IOperationParameterDefinition> Parameters { get; }

        /// <summary>
        /// Gets the range of the parameters
        /// </summary>
        IRange<int> ParameterRange { get; }

        /// <summary>
        /// Determines whether the operation has paremeters.
        /// </summary>
        bool HasParameters { get; }

        /// <summary>
        /// Gets the method/action to be excuted when <see cref="Execute"/> is called.
        /// </summary>
        Action<IEntity, IAlgorithmCycler, IGame, IOperation> ExecutionMethod { get; }
    }
}
